from redis import StrictRedis
class Config():
    DEBUG = True
#     设置密钥
    SECRET_KEY = '4bx65lfggLHN3nvPxLYVGpL894pJaWu+XXvHuc93fZLgKpLMyqPoRA=='
#     配置数据库连接 动态修改
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

#     配置状态保持存储的新session信息
    SESSION_TYPE = 'redis'
#     配置session的签名
    SESSION_USE_SIGNER = True

#     构造reais实例
    SESSION_REDIS = StrictRedis(host='127.0.0.1',port=6379)
#     配置session的过期时间
    PERMANENT_SESSION_LIFETIME = 86400

class developmentConfig(Config):
    DEBUG = True

class productionConfig(Config):
    DEBUG = False

config = {
    'development':developmentConfig,
    'production':productionConfig
}